package com.producteev4j.model.json.user;

import com.producteev4j.model.response.BaseResponse;
import com.producteev4j.model.response.FacebookId;
import com.producteev4j.model.response.User;
import com.producteev4j.model.response.UserWrapper;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;

import java.util.Arrays;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: jcarrey
 * Date: 14/05/11
 * TimeImpl: 19:16
 * To change this template use File | Settings | File Templates.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class UserImpl extends BaseResponse implements User {

    @JsonProperty("id_user")
    private long idUser;
    private String firstname;
    private String lastname;
    private String company;
    private String email;
    private String timezone;
    @JsonProperty("time_signup")
    private String timeSignup;
    private String lang;
    private String avatar;
    private int deleted;
    @JsonProperty("default_dashboard")
    private long defaultDashboard;

    @JsonProperty("sort_by")
    private int sortBy;

    private List<UserWrapperImpl> colleagues;

    private List<FacebookIdImpl> facebooks;

    @JsonProperty("dashboard_status")
    private int dashboardStatus;

    public int getDashboardStatus() {
        return dashboardStatus;
    }

    public void setDashboardStatus(int dashboardStatus) {
        this.dashboardStatus = dashboardStatus;
    }

    public List<? extends FacebookId> getFacebooks() {
        return facebooks;
    }

    public void setFacebooks(List<FacebookIdImpl> facebooks) {
        this.facebooks = facebooks;
    }

    public long getIdUser() {
        return idUser;
    }

    public void setIdUser(long idUser) {
        this.idUser = idUser;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getLastname() {
        return lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getTimezone() {
        return timezone;
    }

    public void setTimezone(String timezone) {
        this.timezone = timezone;
    }

    public String getTimeSignup() {
        return timeSignup;
    }

    public void setTimeSignup(String timeSignup) {
        this.timeSignup = timeSignup;
    }

    public String getLang() {
        return lang;
    }

    public void setLang(String lang) {
        this.lang = lang;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public long getDefaultDashboard() {
        return defaultDashboard;
    }


    public int getDeleted() {
        return deleted;
    }

    public void setDeleted(int deleted) {
        this.deleted = deleted;
    }

    public void setDefaultDashboard(long defaultDashboard) {
        this.defaultDashboard = defaultDashboard;
    }

    public List<? extends UserWrapper> getColleagues() {
        return colleagues;
    }

    public void setColleagues(List<UserWrapperImpl> colleagues) {
        this.colleagues = colleagues;
    }

    public int getSortBy() {
        return sortBy;
    }

    public void setSortBy(int sortBy) {
        this.sortBy = sortBy;
    }

    @Override
    public String toString() {
        return new StringBuilder("UserImpl{").append(
                "idUser=").append(idUser).append(
                ", firstname='").append(firstname).append('\'').append(
                ", lastname='").append(lastname).append('\'').append(
                ", company='").append(company).append('\'').append(
                ", email='").append(email).append('\'').append(
                ", timezone='").append(timezone).append('\'').append(
                ", timeSignup='").append(timeSignup).append('\'').append(
                ", lang='").append(lang).append('\'').append(
                ", avatar='").append(avatar).append('\'').append(
                ", deleted=").append(deleted).append(
                ", defaultDashboard=").append(defaultDashboard).append(
                ", sortBy=").append(sortBy).append(
                ", colleagues=").append((colleagues == null ? null : Arrays.asList(colleagues))).append(
                '}').toString();
    }
}
